Skip to content

Add typed JSON output to app function run - #8756

Draft
gonzaloriestra wants to merge 1 commit into
gonzalo/function-info-jsonfrom
gonzalo/function-run-json
Draft

gonzaloriestra wants to merge 1 commit into
gonzalo/function-info-jsonfrom
gonzalo/function-run-json

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

app function run --json streams unvalidated child output. A failed execution can print a result followed by another fatal document, and runner diagnostics are not structured side events.

WHAT is this pull request doing?

Capture and validate the native Function runner 7.x/9.x result before encoding it. Preserve native keys and payloads, text presentation, and Speedscope files. Completed Function failures emit one result and exit nonzero; setup and invalid-output failures use the shared fatal-error envelope. Keep target prompting independent from JSON and honor --no-input.

Normal output (excerpt):

Output
{"operations":[]}
Benchmark Results
Name: function.wasm
Linear Memory Usage: 64KB
Instructions: 1K

Matching JSON:

{
  "name": "function.wasm",
  "size": 1,
  "memory_usage": 64,
  "instructions": 1000,
  "logs": "",
  "input": {},
  "output": {"operations": []},
  "success": true
}

How to manually test your changes?

shopify app function run --path /path/to/function --input input.json
shopify app function run --path /path/to/function --input input.json --json
shopify app function run --path /path/to/function --input input.json --json --profile
shopify app function run --json-schema

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — added a major changeset for the existing JSON contract

Stack

  1. Add typed JSON output to app function info #8755 — Function info
  2. Add typed JSON output to app function run #8756 — Function run
  3. Add typed JSON output to app function replay #8757 — Function replay

@gonzaloriestra

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Potential Breaking Changes Detected

This PR contains changes that may break the existing contract.

@shopify/dev_experience — this PR contains breaking changes that require coordination for the next major release.

📦 Major Version Changesets

The following changesets request a major version bump:

Changeset Package
function-run-json-contract.md '@shopify/cli': major

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Built from 9dcc885327f517185dafedc8039580a680f75957. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261005124842

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@gonzaloriestra
gonzaloriestra added this pull request to stack #8773 October 6, 2026 08:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant